package com.linkoog.devtools.http.request.http_send;

import com.intellij.icons.AllIcons;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.DefaultActionGroup;
import com.intellij.openapi.actionSystem.impl.ActionButton;
import com.intellij.ui.JBColor;
import com.intellij.ui.components.JBOptionButton;
import com.intellij.ui.components.JBTextField;
import com.intellij.util.ui.JBUI;
import com.linkoog.devtools.http.HttpPluginIcons;
import com.linkoog.devtools.intellij.action.JActionButton;
import com.linkoog.devtools.intellij.swing.IconButton;
import com.linkoog.devtools.intellij.ui.button.InlineIconButton;
import com.linkoog.devtools.intellij.ui.button.SplitButton;
import lombok.Getter;
import net.miginfocom.layout.LC;
import net.miginfocom.swing.MigLayout;
import org.jetbrains.annotations.NotNull;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.util.ArrayList;

@Getter
public class HttpServiceTestSendPanel extends JPanel implements Disposable {

    private final HttpMethodLabel httpMethodLabel;
    private final JBTextField urlTextField;
    private final JButton sendButton;

    public HttpServiceTestSendPanel() {
        super(new MigLayout(new LC().gridGap("10", "0").insets("3", "11", "3", "12").fillX()));
        setBorder(JBUI.Borders.customLine(JBColor.LIGHT_GRAY));

        httpMethodLabel = new HttpMethodLabel();
        add(httpMethodLabel,"align left ");

        urlTextField = new JBTextField();
        urlTextField.setBackground(Color.decode("#F7F8FA"));
        urlTextField.setBorder(JBUI.Borders.emptyRight(5));
        urlTextField.getEmptyText().setText("输入 http 或 https 起始的完整 URL");
        add(urlTextField, "align left, growx, push");

        sendButton = new JActionButton("", AllIcons.Actions.Execute);
        sendButton.setFocusable(false);
        add(sendButton, "align right, wrap");

        setBackground(JBColor.WHITE);
    }

    @Override
    public void dispose() {

    }
}
